#include "MVPShader.h"

#include "WRenderer.h"
#include "SceneNode.h"
#include "BindingPt.h"

#include "CheckError.h"

MVPShader::MVPShader()
	: Shader()
{
	this->vertFilePath = "vertexMVP.vert";
	this->fragFilePath = "fragShader.frag";
}

MVPShader::~MVPShader()
{
}


void MVPShader::Init()
{
	Shader::Init();
	
	Shader::Bind();
	projViewMat = glGetUniformBlockIndex(this->getProgramID(), "UniformParams");
	shaderParam = glGetUniformBlockIndex(this->getProgramID(), "ShaderParams");
	materialParam = glGetUniformBlockIndex(this->getProgramID(), "MatParams");

	glUniformBlockBinding(this->getProgramID(), projViewMat, VIEW_PROJ_UBO);
	glUniformBlockBinding(this->getProgramID(), shaderParam, SHADER_PARAM);
	Shader::Unbind();
}